package P9;

public class P9_isPalindrome {

    public static void main(String[] args) throws Exception {

        System.out.println(new P9_isPalindrome().isPalindrome(23432));
    }

    public boolean isPalindrome(int x) {

        if (x < 0)  {
            return false;
        }

        String s1 = String.valueOf(x);
        StringBuilder sb2 = new StringBuilder();
        sb2.append(x).reverse();

        return s1.equals(sb2.toString());
    }
}
